#ifndef xpack_macro_xstruct_inc
#define xpack_macro_xstruct_inc
#pragma push_macro("xuser")
#undef  xuser
#define xuser mixc::macro_xstruct_inc
#include"dumb/place_holder.hpp"
#include"meta/is_ref.hpp"
#include"meta/remove_ref.hpp"
#include"meta/remove_volatile.hpp"
#include"meta_seq/tlist.hpp"
#include"meta_seq/vlist.hpp"
#include"meta_seq/vmerge.hpp"
#pragma pop_macro("xuser")

namespace mixc::macro_xstruct_inc{
    template<class self_t, class ... list_t>
    struct data_field_collector{
    private:
        template<class a0_t, class ... args_t, auto ... result_v>
        static auto merge(vlist<result_v...>){
            typename vmerge<vlist<result_v...>, a0_t>::new_list items;

            if constexpr (sizeof...(args_t) == 0){
                return items;
            }
            else{
                return merge<args_t...>(items);
            }
        }
    public:
        using member_list = decltype(merge<
                typename self_t::member_list_partial,
                typename list_t::member_list...
            >(vlist<>())
        );
    };

    template<class ignore, class ... rest>
    using base_list = tlist<rest...>;

    template<auto ignore, auto ... rest>
    using member_list_partial = vlist<rest...>;

    template<class type>
    struct fake{ type * item = nullptr; };
}

template<uxx index_v>
using __xstruct_dph = mixc::macro_xstruct_inc::place_holder<index_v, true>;

template<class self_t, class ... list_t>
using __xstruct_dfc = typename mixc::macro_xstruct_inc::data_field_collector<self_t, list_t...>::member_list;

template<class ignore_t, class ... rest_t>
using __xstruct_bl = mixc::macro_xstruct_inc::base_list<ignore_t, rest_t...>;

template<class ... rest_t>
using __xstruct_tl = mixc::macro_xstruct_inc::tlist<rest_t...>;

template<auto ignore_t, auto ... rest_t>
using __xstruct_mlp = mixc::macro_xstruct_inc::member_list_partial<ignore_t, rest_t...>;

template<class type_t>
using __xstruct_fake = mixc::macro_xstruct_inc::fake<type_t>;

template<class type_t>
using __xstruct_rr = mixc::macro_xstruct_inc::remove_ref<type_t>;

template<class type_t>
using __xstruct_rv = mixc::macro_xstruct_inc::remove_volatile<type_t>;

template<class type_t = void>
using __xstruct_repeat = type_t;

#endif
